<?php
require("inc/common.inc.php");
if($type == 'check'){
	$status = 1;
	$table = "mx_share";
	$ident = urldecode($ident);
	$mxuserid = $_COOKIE['userid'];
	$shareInfo = $db->getinfo("select * from $table where ident='".$ident."' and userid=".$mxuserid);
	if($shareInfo){
		$data['count'] = $shareInfo['count']+1;
		$data['updatetime'] = time();
		$query = $db->sql_update($table, $data,"id=".$shareInfo['id']);
		$db->excu($query);
	}else{
		//分享信息入库
		$insert_fields['ident'] = $ident;
		$insert_fields['userid'] = $mxuserid;
		$insert_fields['createtime'] = time();
		$db->exe_insert($table, $insert_fields);
		addIntegral(5,$mxuserid,"分享");
	}
}
?>